#include <bits/stdc++.h>
using namespace std;

int n, m;
char grid[1001][1001]; //原始地图
vector<pair<int, int>> ans; //存放答案（坐标）
int direction[8][2] = {{-1,-1}, {-1,0}, {-1,1}, {0,-1}, {0,1}, {1,-1}, {1,0}, {1,1}}; //九宫格中心出发的八个可行方向

bool check(int x, int y);
bool find(int tx, int ty);

int main() {
    cin >> n >> m;
    for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
    cin >> grid[i][j];

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (grid[i][j] == '.') {  //所有"."都可能藏暖炉
                check(i, j);
            }
        }
    }
    if (ans.size()==0) {
        cout << "Too cold!\n";
    } else {
        for (auto &p : ans) {
            cout << p.first << " " << p.second << '\n';
        }
    }
    return 0;
}

bool check(int x, int y) {
    // 检查周围是否有 'c'
    for (int i = 0; i < 8; ++i) {
        int tx = x + direction[i][0];
        int ty = y + direction[i][1];
        if (tx < 0 || tx >= n || ty < 0 || ty >= m) continue;
        if (grid[tx][ty] == 'c') return false;
    }

    // 检查周围是否有 'w' 且符合条件
    for (int i = 0; i < 8; ++i) {
        int tx = x + direction[i][0];
        int ty = y + direction[i][1];
        if (tx < 0 || tx >= n || ty < 0 || ty >= m) continue;
        if (grid[tx][ty] == 'w') {
        if (find(tx, ty)) {
            ans.emplace_back(x, y);
        return true;
        }
        }
    }
    return false;
}

bool find(int tx, int ty) {  //检测"w"周围有无能让水豚变暖的暖炉
    for (int i = 0; i < 8; ++i) {
        int xx = tx + direction[i][0];
        int yy = ty + direction[i][1];
        if (xx < 0 || xx >= n || yy < 0 || yy >= m) continue;
        if (grid[xx][yy] == 'm') return false;}
    return true;
}